//这是模板函数
#include<iostream>
using namespace std;
template<typename T>
void swap1(T& t1, T& t2)
{
	T temp = t2;
	t2 = t1;
	t1 = temp;
}

int main(void)
{
    int a = 3, b = 4;
    swap1(a,b);
    cout << "a = " << a << " b = " << b << endl;
    float c = 3.14, d = 4.13;
    swap1(c,d);
    cout <<"c = " << c << " d = " << d << endl;
    return 0;
}